package com.first.teacher.controller;

import com.first.common.pojo.TbCheckTeacher;
import com.first.common.vo.Result;
import com.first.teacher.service.TbCheckTeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: first-project
 * @description:
 * @author: 马英贤
 * @create: 2023-05-29 19:26
 **/
@RestController
@RequestMapping("core/tbteacher")
@Api(tags = "导师审核状态")
public class TbCheckTeacherController {
    @Autowired
    private TbCheckTeacherService tbCheckTeacherService;
    @PostMapping("/teacherStatus")
    @ApiOperation(value = "修改导师审核状态")
    public Result TeacherStatus(@RequestBody TbCheckTeacher tbCheckTeacher){
       if (tbCheckTeacher.getCheckStatus().equals("2")){
           return Result.success("已设置为待审核",null);
       }
       int i = tbCheckTeacherService.modifyTeacher(tbCheckTeacher);
       if (i == 0){
           return Result.success("未通过审核",null);
       }
        return Result.success("审核已通过",null);
    }
}
